package com.zzy.librarytest.dao;

import com.zzy.librarytest.entity.Book;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface BookDao {
    @Select("select * from t_book")
    List<Book> selectAllBook();
    @Insert("insert into t_book(bookname,author,press,price) values(#{bookname},#{author},#{press},#{price})")
    Integer saveBook(Book book);
    @Select("select * from t_book where id=#{id}")
    Book selectBook(Integer id);
    @Update("update t_book set bookname=#{bookname},author=#{author},press=#{press},price=#{price} where id=#{id} ")
    Integer updateBook(Book book);
    @Delete("delete from t_book where id=#{id}")
    Integer deleteBook(Integer id);
}
